<?php 
	return '';
?>
<div id="tasks">
	 <div>Andere Aufgaben:</div>
	<ul>
		<?
		
			// TODO check why tasks_title must be an extra class
			$targets = array(
				'admin' => array(
					'admin' => array(
						'Admin' => '/admin/',
					),
					'users' => array(
						'User anlegen' => '/admin/users/add',
						'User verwalten' => '/admin/users/',
					),
					'roles' => array(
						'Rolle anlegen' => '/admin/roles/add',
						'Rollen verwalten' => '/admin/roles/',
					)	
				),
				'manager' => array(
					'manager' => array(
						'Manager' => '/manager/',
					),
					'notices' => array(
						'Meldung anlegen' => '/manager/notices/add',
						'Meldung verwalten' => '/manager/notices/',
					),
					'companies' => array(
						'Unternehmen anlegen' => '/manager/companies/add',
						'Unternhemen verwalten' => '/manager/companies/',
						'Kontakt anlegen' => '/manager/contactPersons/add',
						'Kontakte verwalten' => '/manager/contactPersons/',
					),	
					'students' => array(
						'Student anlegen' => '/manager/students/add',
						'Studenten verwalten' => '/manager/students/',
					),	
					'courses' => array(
						'Kurs anlegen' => '/manager/courses/add',
						'Kurse verwalten' => '/manager/courses/',
					),	
					'profiles' => array(
						'Profil anlegen' => '/manager/profiles/add',
						'Profile verwalten' => '/manager/profiles/',
					),	
					'professors' => array(
						'Dozent anlegen' => '/manager/professors/add',
						'Dozenten verwalten' => '/manager/professors/',
					),
					'studyBranches' => array(
						'Studienrichtung anlegen' => '/manager/studyBranches/add',
						'Studienrichtung verwalten' => '/manager/studyBranches/',
					)
				),
			);
			
			if(substr($target,0,1)=='/'){
				$target = substr($target,1,strlen($target)-1);
			}
			
			if(substr($target,-1)=='/'){
				$target = substr($target,0,strlen($target)-1);
			}
			
			// explode ---------------------------------------
			
			$explode = explode('/', $target);
			
			if(sizeof($explode)>0 && array_key_exists($explode[0], $targets[$explode[0]])) {
				$tasks = $targets[$explode[0]][$explode[0]];
				foreach($tasks as $key => $value){
					//echo '<li><a href="'.$value.'">'.$key.'</a><br></li>';
					echo '<li>'.$this->Html->link($key, $value).'</li>';
				}
			}
			
			if(sizeof($explode)>=2) {
				$tasks = $targets[$explode[0]][$explode[1]];
				foreach($tasks as $key => $value){
					//echo '<li><a href="'.$value.'">'.$key.'</a><br></li>';
					echo '<li>'.$this->Html->link($key, $value).'</li>';
				}
			}
			
			
		?>
	</ul>
</div>